package com.util;

import com.badlogic.gdx.graphics.g2d.tiled.TileSet;
import com.badlogic.gdx.graphics.g2d.tiled.TiledMap;

public class TiledMapUtil {
	public static TileSet getTileSetByName(TiledMap tiledMap,String name)
	{
		TileSet ts = null;
		for(TileSet tss:tiledMap.tileSets)
		{
			if(name.equals(tss.name)){
				ts = tss;break;
			}
		}
		return ts;
	}
	public static String getTileSetProperty(TileSet ts,String propertyName)
	{
		return ts.toString();
	}
	public static boolean isInBlock(float rx,float ry,float x,float y,int radio)
	{
		if(rx>=x-radio && rx<=x+radio && ry >=y-radio && ry<=y+radio)
			return true;
		return false;
	}
}
